<div class="publish-main-container">
    <nz-card style="width: 100%;" nzTitle="日实际用水上报" [nzExtra]="btnGroupWebTemplate1">
        <div class="content-card-box">
            <ng-container *ngFor="let busData of webBusTableDatas;">
                <div class="sub-table-container">
                    <nz-table [nzData]="busData"
                              nzBordered
                              [nzFrontPagination]="false"
                              nzSize="middle">
                        <thead>
                        <tr>
                            <th>取/退水口</th>
                            <th nzWidth="80px">8时流量(m³/s)</th>
                            <th nzWidth="130px">昨日平均流量（m³/s）</th>
                            <th nzWidth="80px">昨日水量（万m³）</th>
                            <th nzWidth="100px">水量参考值（万m³）</th>
                            <th nzWidth="45px">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr *ngFor="let data of busData;" class="editable-row">
                            <td>
                                {{data.sideName}}
                            </td>
                            <td>
                                <ng-container *ngIf="!editWebBusCache[data.sideId].edit; else flowEightInputTpl">
                                    {{data.flowEight}}
                                </ng-container>
                                <ng-template #flowEightInputTpl>
                                    <input type="text" nz-input
                                           [(ngModel)]="editWebBusCache[data.sideId].data.flowEight"/>
                                </ng-template>
                            </td>
                            <td>
                                <ng-container
                                    *ngIf="!editWebBusCache[data.sideId].edit; else flowAverInputTpl">
                                    {{data.flowAver}}
                                </ng-container>
                                <ng-template #flowAverInputTpl>
                                    <input type="text" nz-input
                                           [(ngModel)]="editWebBusCache[data.sideId].data.flowAver"/>
                                </ng-template>
                            </td>
                            <td>
                                <ng-container *ngIf="!editWebBusCache[data.sideId].edit; else waterQuaInputTpl">
                                    {{data.waterQua}}
                                </ng-container>
                                <ng-template #waterQuaInputTpl>
                                    <input type="text" nz-input
                                           [(ngModel)]="editWebBusCache[data.sideId].data.waterQua"/>
                                </ng-template>
                            </td>
                            <td>
                                <ng-container
                                    *ngIf="!editWebBusCache[data.sideId].edit; else waterDefInputTpl">
                                    {{data.waterDef}}
                                </ng-container>
                                <ng-template #waterDefInputTpl>
                                    <input type="text" nz-input
                                           [(ngModel)]="editWebBusCache[data.sideId].data.waterDef"/>
                                </ng-template>
                            </td>
                            <td>
                                <div class="editable-row-operations">
                                    <ng-container *ngIf="!editWebBusCache[data.sideId].edit; else saveTpl">
                                        <a (click)="startWebBusEdit(data.sideId)">
                                            修改
                                        </a>
                                    </ng-container>
                                    <ng-template #saveTpl>
                                        <a (click)="saveWebBusEdit(data.sideId)">保存</a>
                                        <a nz-popconfirm nzTitle="确认取消?" (nzOnConfirm)="cancelWebBusEdit(data.sideId)">取消</a>
                                    </ng-template>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </nz-table>
                </div>
            </ng-container>
        </div>

    </nz-card>
    <ng-template #btnGroupWebTemplate1>
        <div style="display: inline-block">
            日期：
            <nz-date-picker [(ngModel)]="today" (ngModelChange)="queryInfo()"></nz-date-picker>
        </div>
        <button nz-button nzType="primary" (click)="confirm()">确认</button>
        <button nz-button nzType="default" (click)="reset()">取消</button>
    </ng-template>
</div>


